<?php 

@session_start();

// echo "<pre>";
// print_r($_SESSION);
// echo "</pre>";

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>

<?php 
echo '	<head>';

$currentFile = $_SERVER["PHP_SELF"];
$parts = Explode('/', $currentFile);
$pagename = $parts[count($parts) - 1];
echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
if(!$_SESSION["connected"]){
	if($pagename == "index.php" || $pagename == "ajoutProfil.php" || $pagename == ""){
		echo '<meta name="description"
		content="Prototype Cellier virtuel - Connexion" />
		<title>Accueil - Connexion</title>';
	} else {
		header("Location: index.php");
	}
}
echo '<link rel="stylesheet" type="text/css" href="css/style.css" />';
echo '</head>';
?>
<?php 
if (isset($_SESSION['profilActuel'])){
	// echo "LOL";
}?>
<body>
	<div id="menu">
		<ul>
			<?php 
			if($_SESSION["connected"]){
				echo "<li><a href=\"logout.php\">Déconnexion</a></li>";
			} else{
				echo "<li><a href=\"index.php\">Connexion</a></li>";
			}
			?>
			
			<li><a href="favoris.php">Favoris</a></li>
		</ul>
	</div>